package com.timberwood.view;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletContext;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings({"rawtypes","unchecked"})
public class GalleryAction extends ActionSupport {
	private static final long serialVersionUID = 4186284158081206333L;

	
	private List listUrl;
	public List getListUrl() {
		return listUrl;
	}
	
	public String slideHome(){
		ServletContext application = ServletActionContext.getServletContext();
		File dir=new File(application.getRealPath("/images/image-gallery/imghome"));
		String[] listfilename=dir.list();
		listUrl=new ArrayList();
		for(int i=0;i<listfilename.length;i++){
			listUrl.add("../images/image-gallery/imghome/"+listfilename[i]);
		}
		
		return SUCCESS;
	}
	
	
}
